<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGamesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('games', function (Blueprint $table) {
            $table->increments('id');
            $table->string('category_slug')->index();//分类别名
            $table->string('name')->index();//游戏名称
            $table->string('package_name', 100)->nullable()->index();//游戏包名
            $table->string('size')->nullable();//游戏大小
            $table->string('brief_desc')->nullable();//简要描述
            $table->text('description')->nullable();//游戏详细描述
            $table->string('icon');//游戏图标
            $table->string('poster')->nullable();//游戏海报
            $table->string('download_url');//游戏下载地址
            $table->string('wx_download_url');//微信下载地址

            $table->integer('download_counts')->default(0);//游戏下载次数

            $table->boolean('top')->default(false)->index();//首页推荐
            $table->boolean('banner')->default(false)->index();//banner推荐
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('games');
    }
}
